package com.cdcas;

import java.nio.charset.StandardCharsets;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
import java.util.regex.Pattern;

public class regClass {
    public static void main(String[] args) {
        //手机号的验证
//        String reg = "^1[3-9]\\d{9}$";
//        String phone = "16999876647";
//        System.out.println(phone.matches(reg));
        //Pattern使用
//        String s = "jfidufehi7768jjhgejfi9986f5dfrgrrgr8976deed";
//        String reg = "\\d+";
//        Pattern pattern = Pattern.compile(reg);
//        String[] strs = pattern.split(s);
//        for (String tmp :strs) {
//            System.out.println(tmp);
//        }
//        String msg = "aaaaaaa";
//        Base64.Encoder encoder = Base64.getEncoder();
//        byte[] enByte = encoder.encode(msg.getBytes());
//        System.out.println(new String(enByte));
//
//        //解密过程
//        Base64.Decoder decoder = Base64.getDecoder();
//        byte[] dByte = decoder.decode(enByte);
//        System.out.println(new String(dByte));


        //map存储以及获取
        Map<String,Object> map = new HashMap<>();
        map.put("sno","20240001");
        map.put("sname","zhangsan");
        map.put("age",18);
        System.out.println("学生学号:" + map.get("sno") + " 姓名:" + map.get("sname") + " 年龄：" + map.get("age"));


    }
}
